package com.situ.spring.Test;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.situ.spring.entity.Student;

public class SpringTest {
	
	@Test
	public void test1() {
		//得到Spring容器
		ApplicationContext context = 
				new ClassPathXmlApplicationContext("applicationContext.xml");
		//从Spring容器得到bean
		Student student = (Student) context.getBean("student");
		Student student2 = (Student) context.getBean("student");
		System.out.println(student);
		System.out.println(student == student2);
	}
}
